{extend name="shop/b2c/Member/base" /}
{block name="main"}
<style type="text/css">
.user-right>.box>.tabmenu>.tab>.active {
	font-size: 18px;
	border-bottom: 3px #ff6600 solid;
}

.back-table-tr th {
	border: 1px solid #EEE;
}
</style>
<div class="user-right">
	<div class="box">
		<div class="tabmenu">
			<ul class="tab pngFix">
				<li class="active" id="active_list">退款/退货/维修订单列表</li>
			</ul>
		</div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0"
			class="bought-table">
			<thead>
				<tr class="col-name">
					<th width="25%" style="border-left: 1px solid #E6E6E6;">宝贝</th>
					<th width="20%">属性</th>
					<th width="10%">单价(元)</th>
					<th width="10%">数量</th>
					<th width="15%">售后</th>
					<th width="10%">退款金额(元)</th>
					<th width="10%">退款状态</th>
				</tr>
			</thead>
			<tbody class="close-order">
			{if condition="count($orderList) neq 0"}
			{volist name="orderList" id="order"}
				<tr class="order-hd">
					<td colspan="8">
						<span class="no"> 订单编号：<span class="order-num">{$order.order_no}</span></span>
						<span class="deal-time">&nbsp;&nbsp;成交时间：<span>{$order.create_time}</span></span>
						<span class="deal-time">&nbsp;&nbsp;{$order.shop_name}</span>
					</td>
				</tr>
				{volist name="order['order_item_list']" id="order_item" key="k"}
				<tr class="order-hd">
					<td align="center" class="baobei no-border-right order_goods_info">
						<div class="goods_desc last">
							<a class="pic" href="SHOP_MAIN/goods/goodsinfo?goodsid={$order_item.goods_id}" title="查看{$order_item.goods_name}商品详情" target="_blank">
								<img src="__ROOT__/{$order_item['picture']['pic_cover_micro']}" alt="" width="50" height="50">
							</a>
							<div class="goods_name">{$order_item.goods_name}</div>
						</div>
					</td>
					<td align="center" class="baobei no-border-right order_goods_attr">
						<div class="goods_desc goods_desc_t last" style="line-height: 50px;">{$order_item.sku_name}</div>
					</td>
					<td align="center" class="baobei no-border-right order_goods_info" style="padding: 0px;">
						<div class="goods_desc price  last" style="padding-left: 0px; line-height: 50px;">￥{$order_item.price}</div>
					</td>
					<td align="center" class="baobei no-border-right order_goods_info" style="padding: 0px;">
						<div class="goods_desc  last" style="padding-left: 0px; line-height: 50px;">{$order_item.num}</div>
					</td>
					<td align="center" class="after-service baobei no-border-right order_goods_info" valign="middle">
						<div class="goods_desc last">
							<!-- <a href="" >留言/投诉</a> -->
							{if condition="$order.is_refund eq 1 AND
							$order_item.refund_status eq 0"}
							<div>
								<a href="SHOP_MAIN/member/refunddetail.html?order_goods_id={$order_item.order_goods_id}" style="text-decoration: underline; color: #E31939;">退款/退货</a>
							</div>
							{elseif condition="$order.is_refund eq 1"}
							<div>
								<a href="SHOP_MAIN/member/refunddetail.html?order_goods_id={$order_item.order_goods_id}" style="border: 1px solid #03A9F4; padding: 3px 8px; color: #03A9F4; line-height: 35px;">查看退款</a>
							</div>
							<div>
								<a href="javascript:;" class="cancle" style="border: 1px solid #E31939; padding: 3px 8px; color: #E31939; line-height: 45px;" onclick="if(confirm('确定取消当前退款?'))cancleDetail({$order.order_id},{$order_item.order_goods_id})">取消退款</a>
							</div>
							{/if}
						</div>
					</td>
					<td align="center" class="amount no-border-right">
						<p class="post-type">
							<strong>￥{$order_item.refund_require_money}</strong>
						</p>
					</td>
					{if condition="$k eq 1"}
					<td rowspan="{$order.order_item_list|count}" align="center" class="trade-status no-border-right">
						<div>{$order.status_name}</div>
						<a href="SHOP_MAIN/Member/orderDetail.html?orderId={$order.order_id}" class="main-color">订单详情</a>
					</td>
					{/if}
				</tr>
				{/volist}
			{/volist}
			{else/}
			<div class="myorder-none">
				<i class="icon-none"></i><span class="none_01">您还没有相关的订单</span>
				<span class="none_02">去看看大家都在买什么吧</span>
				<span class="none_03"><a href="APP_MAIN/Goods/goodsList.html">随便逛逛</a></span>
			</div>
			{/if}
			</tbody>
		</table>
		{include file='shop/b2c/controlCommonPage'/}
	</div>
</div>
{/block}
{block name="javascript"}
<script type="text/javascript">
function cancleDetail(order_id,order_goods_id){
	$.ajax({
		url: "SHOP_MAIN/Member/cancleOrder",
		type: "post",
		data:{ "order_id" : order_id, "order_goods_id" : order_goods_id },
		dataType:"json",
		success: function(res){
			if(res['code']>0){
				$.msg("取消退款成功");
				location.href="SHOP_MAIN/member/backlist";
			}
		}
	})
 }
</script>
{/block}